<table border = "0" width = "100%"><tr><td>
    Type: <%=h @ticket.ticket_template.name %><br />
    <label for="ticket_number">Number:</label> <%= @ticket.number %><br />
    <label for="ticket_name">Name:</label>
	<%= @ticket.name  %><br />
        Created by <%=h @ticket.created_by ? @ticket.created_by.name : "somebody"%><br />
        <% if @ticket.updated_at %>
        <%= @ticket.group_id == 0 ? "Closed by" : "Updated by" %> <%=h @ticket.updated_by ? @ticket.updated_by.name : "somebody" %> at <%= @ticket.updated_at  %><br />
        <% end %>
	
Deadline: <%=  @ticket.deadline %><br />
Status:	<%=  @ticket.status? ? " finished" : " not finished" %><br />
<%=  @ticket.group ? "Group: #{@ticket.group.name}" : "Ticket closed" %><br />
</td>
        
	<td align = 'right'>         
          <% if current_user.admin? %>
           <%= link_to "Destroy", ticket_path(@ticket), :method => :delete, :confirm => "Are you sure?" %>
          <% end %>
</td></tr></table>
<%= render :partial => 'show_fields'-%>

<% @ticket.comments.each do |comment| %>
<span class="username"><%=h comment.user ? comment.user.name : "Somebody"-%></span> wrote at <%= comment.created_at -%>: 
<p class="comment"> <%= comment.value %> </p>
<% end %>
